package com.dwxt.cdms.dao;

import com.dwxt.cdms.applets.dto.IndexGraphDayResDTO;
import com.dwxt.cdms.applets.dto.IndexGraphResDTO;
import com.dwxt.cdms.applets.dto.IndexReqDTO;
import com.dwxt.cdms.entity.Customer;
import com.dwxt.cdms.entity.HeartVoice;
import com.dwxt.cdms.entity.HeartVoiceExample;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface HeartVoiceMapper {
    int countByExample(HeartVoiceExample example);

    int deleteByExample(HeartVoiceExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(HeartVoice record);

    int insertSelective(HeartVoice record);

    List<HeartVoice> selectByExample(HeartVoiceExample example);

    HeartVoice selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") HeartVoice record, @Param("example") HeartVoiceExample example);

    int updateByExample(@Param("record") HeartVoice record, @Param("example") HeartVoiceExample example);

    int updateByPrimaryKeySelective(HeartVoice record);

    int updateByPrimaryKey(HeartVoice record);

    int deleteByIds(@Param("ids")Integer[] ids);

    List<Map> selectHeartVoicePage(@Param("customer") Customer customer, @Param("isAbnormal") Integer isAbnormal,
                                   @Param("start") String start, @Param("end") String end,
                                   @Param("customerId") String customerId);

    @Select("SELECT * FROM heart_voice_info WHERE customerId=#{customerId,jdbcType=INTEGER} ORDER BY create_time DESC LIMIT 1;")
    HeartVoice selectNewOne(@Param("customerId")Integer customerId);

    List<Map> selectHeartVoicePageGroup(@Param("customer") Customer customer, @Param("isAbnormal") Integer isAbnormal,
                                   @Param("start") String start, @Param("end") String end,@Param("stationId")Integer stationId);

    int deleteByCustomerIds(@Param("ids") Integer[] ids);

    List<IndexGraphDayResDTO> selectGraphWithDay(IndexReqDTO indexReqDTO);

    List<IndexGraphResDTO> selectGraphData(IndexReqDTO indexReqDTO);

    List<HeartVoice> selectCustomerHeartVoice(String customerId, Integer scope);
}